package cz.cuni.amis.episodic.bayes.experiment;

import cz.cuni.amis.episodic.bayes.memories.IntervalSurpriseMemoryCreator;
import cz.cuni.amis.episodic.bayes.memories.MemoryCreator;
import cz.cuni.amis.episodic.bayes.memories.MinimizeKLMemoryCreator;
import cz.cuni.amis.episodic.bayes.memories.PointSurpriseMemoryCreator;
import cz.cuni.amis.episodic.bayes.utils.chart.AgregateGraphDevice;
import cz.cuni.amis.episodic.bayes.utils.chart.GraphPaintingDevice;
import cz.cuni.amis.episodic.bayes.utils.chart.PdfGraphDevice;
import cz.cuni.amis.episodic.bayes.utils.chart.PngGraphDevice;
import cz.cuni.amis.episodic.lisp.netcreators.AHMEMCreator;
import cz.cuni.amis.episodic.lisp.netcreators.CHMMCreator;
import cz.cuni.amis.episodic.lisp.netcreators.HHMMCreator;
import cz.cuni.amis.episodic.lisp.netcreators.HHMMMurphyPaskin2001Creator;
import cz.cuni.amis.episodic.lisp.netcreators.NetCreator;
import cz.cuni.amis.episodic.lisp.netcreators.TraceModificationStrategy;
import cz.cuni.amis.episodic.lisp.netcreators.UpperTraceAndObservationStrategy;
import cz.cuni.amis.episodic.lisp.netcreators.UpperTraceStrategy;

import java.io.File;
import java.util.Arrays;
import java.util.List;

/**
 * ICCM 2013 experiment.
 * @author ik
 */
public class Experiment_4b_monroe extends LispExperiment {

	@Override
	protected GraphPaintingDevice createGraphDevice(File rootDir) {
		return new AgregateGraphDevice(new GraphPaintingDevice[] {
                    new PdfGraphDevice(rootDir),
                    new PngGraphDevice(rootDir)}, rootDir);
	}
	
	protected MemoryCreator[] createMemoryCreators(GraphPaintingDevice device) {
		return new MemoryCreator[] {
				new IntervalSurpriseMemoryCreator(device),
                                new MinimizeKLMemoryCreator(device)};
	}
	
	public Experiment_4b_monroe() {
        super("4b_monroe", new File("target/experiments"), new File("../datasets"), "monroe-small.txt");

        networkFilenames = new String[]{};
        batchSize = 10;
        createAndLearnNetworks = true;
        drawMemoryCreationGraphs = true;
        performEvolutionExample = false;
        
        TraceModificationStrategy level1 = new UpperTraceAndObservationStrategy(1);
        TraceModificationStrategy level2 = new UpperTraceAndObservationStrategy(2);
        
        networkCreators =  Arrays.asList(
        		new CHMMCreator(true, level1)
        		//new CHMMCreator(true, level2)
        		/*new AHMEMCreator(2, level1, true),
                new AHMEMCreator(2, level2, true),
        		new AHMEMCreator(4, level1, true),
                new AHMEMCreator(4, level2, true),
        		new AHMEMCreator(8, level1, true),
                new AHMEMCreator(8, level2, true)*/        		
        		);
        
        
    }

	public static void main(String[] args) throws Exception {
		Experiment e = new Experiment_4b_monroe();
		e.perform();
	}
}
